package day7;

/**
 * @author oldliu
 * @since 1.0
 */
public class ObjectArray {
    public static void main(String[] args) {
        //对象数组
        Student p[] = new Student[20];
        System.out.println(p);
        for (int i = 0; i < p.length; i++) {
            //p[i].show();error
            p[i] = new Student("王"+i,(int)(Math.random()*40),(int)(Math.random()*100),(int)(Math.random()*100),(int)(Math.random()*100));

        }
        for (int i = 0; i < p.length; i++) {
            p[i].show();
        }
        System.out.println(">>>>>>>>>>>>>>>>>>>>>");
//        Student a[] = new Student[]{new Student(), new Student(), new Student()};
//        a[0].show();
//        Student a2[] = {new Student()};
    }
}
